home *** CD-ROM | disk | FTP | other *** search
/ VRML 2.0 Sourcebook (2nd Edition) / VRML 2.0 Sourcebook CD [md5 fed90f4f9c39d5a60d477058775c7e21].iso / book / unix / ch15 / 15fig17.wrl < prev   
Text File  |  1996-09-22  |  4KB  |  138 lines

  1. #VRML V2.0 utf8
  2. # The VRML 2.0 Sourcebook
  3. # Copyright [1997] By
  4. # Andrea L. Ames, David R. Nadeau, and John L. Moreland
  5. Group {
  6.     children [
  7.  
  8.     # Ground
  9.         Shape {
  10.             appearance Appearance {
  11.                 material Material {
  12.                     diffuseColor 0.6 0.6 0.0
  13.                 }
  14.             }
  15.             geometry Box { size 20.0 0.01 20.0 }
  16.         },
  17.     # Snake shape
  18.         Transform {
  19.             translation 0.0 0.3 0.0
  20.             children Shape {
  21.                 appearance Appearance {
  22.                     material Material {
  23.                         diffuseColor 0.0 1.0 0.2
  24.                     }
  25.                 }
  26.                 geometry DEF Snake Extrusion {
  27.                     creaseAngle 1.57
  28.                     crossSection [
  29.                     # Circle
  30.                          1.00  0.00,   0.92 -0.38,
  31.                          0.71 -0.71,   0.38 -0.92,
  32.                          0.00 -1.00,  -0.38 -0.92,
  33.                         -0.71 -0.71,  -0.92 -0.38,
  34.                         -1.00 -0.00,  -0.92  0.38,
  35.                         -0.71  0.71,  -0.38  0.92,
  36.                          0.00  1.00,   0.38  0.92,
  37.                          0.71  0.71,   0.92  0.38,
  38.                          1.00  0.00
  39.                     ]
  40.                     spine [
  41.                     # Sine wave
  42.                         -4.100 0.0  0.000,  -4.000 0.0  0.000,
  43.                         -3.529 0.0  0.674,  -3.059 0.0  0.996,
  44.                         -2.588 0.0  0.798,  -2.118 0.0  0.184,
  45.                         -1.647 0.0 -0.526,  -1.176 0.0 -0.962,
  46.                         -0.706 0.0 -0.895,  -0.235 0.0 -0.361,
  47.                          0.235 0.0  0.361,   0.706 0.0  0.895,
  48.                          1.176 0.0  0.962,   1.647 0.0  0.526,
  49.                          2.118 0.0 -0.184,   2.588 0.0 -0.798,
  50.                          3.059 0.0 -0.996,   3.529 0.0 -0.674,
  51.                          4.000 0.0  0.000,
  52.                     ]
  53.                     scale [
  54.                         0.050 0.020,  0.200 0.100,
  55.                         0.400 0.150,  0.300 0.300,
  56.                         0.300 0.300,  0.300 0.300,
  57.                         0.300 0.300,  0.300 0.300,
  58.                         0.300 0.300,  0.300 0.300,
  59.                         0.290 0.290,  0.290 0.290,
  60.                         0.290 0.290,  0.280 0.280,
  61.                         0.280 0.280,  0.250 0.250,
  62.                         0.200 0.200,  0.100 0.100,
  63.                         0.050 0.050,
  64.                     ]
  65.                 }
  66.             }
  67.         },
  68.     # Animation clock
  69.         DEF Clock TimeSensor {
  70.             cycleInterval 4.0
  71.             loop TRUE
  72.         },
  73.     # Animation morph
  74.         DEF SnakeWiggle CoordinateInterpolator {
  75.             key [ 0.0, 0.25, 0.50, 0.75, 1.0 ]
  76.             keyValue [
  77.             # time 0.0 position
  78.                 -4.100 0.0  0.000,  -4.000 0.0  0.000,
  79.                 -3.529 0.0  0.674,  -3.059 0.0  0.996,
  80.                 -2.588 0.0  0.798,  -2.118 0.0  0.184,
  81.                 -1.647 0.0 -0.526,  -1.176 0.0 -0.962,
  82.                 -0.706 0.0 -0.895,  -0.235 0.0 -0.361,
  83.                  0.235 0.0  0.361,   0.706 0.0  0.895,
  84.                  1.176 0.0  0.962,   1.647 0.0  0.526,
  85.                  2.118 0.0 -0.184,   2.588 0.0 -0.798,
  86.                  3.059 0.0 -0.996,   3.529 0.0 -0.674,
  87.                  4.000 0.0  0.000,
  88.             # time 0.25 position
  89.                 -4.100 0.0 -1.000,  -4.000 0.0 -1.000,
  90.                 -3.529 0.0 -0.739,  -3.059 0.0 -0.092,
  91.                 -2.588 0.0  0.603,  -2.118 0.0  0.983,
  92.                 -1.647 0.0  0.850,  -1.176 0.0  0.274,
  93.                 -0.706 0.0 -0.446,  -0.235 0.0 -0.932,
  94.                  0.235 0.0 -0.932,   0.706 0.0 -0.446,
  95.                  1.176 0.0  0.274,   1.647 0.0  0.850,
  96.                  2.118 0.0  0.983,   2.588 0.0  0.603,
  97.                  3.059 0.0 -0.092,   3.529 0.0 -0.739,
  98.                  4.000 0.0 -1.000,
  99.             # time 0.50 position
  100.                 -4.100 0.0  0.000,  -4.000 0.0  0.000,
  101.                 -3.529 0.0 -0.674,  -3.059 0.0 -0.996,
  102.                 -2.588 0.0 -0.798,  -2.118 0.0 -0.184,
  103.                 -1.647 0.0  0.526,  -1.176 0.0  0.962,
  104.                 -0.706 0.0  0.895,  -0.235 0.0  0.361,
  105.                  0.235 0.0 -0.361,   0.706 0.0 -0.895,
  106.                  1.176 0.0 -0.962,   1.647 0.0 -0.526,
  107.                  2.118 0.0  0.184,   2.588 0.0  0.798,
  108.                  3.059 0.0  0.996,   3.529 0.0  0.674,
  109.                  4.000 0.0  0.000,
  110.             # time 0.75 position
  111.                 -4.100 0.0  1.000,  -4.000 0.0  1.000,
  112.                 -3.529 0.0  0.739,  -3.059 0.0  0.092,
  113.                 -2.588 0.0 -0.603,  -2.118 0.0 -0.983,
  114.                 -1.647 0.0 -0.850,  -1.176 0.0 -0.274,
  115.                 -0.706 0.0  0.446,  -0.235 0.0  0.932,
  116.                  0.235 0.0  0.932,   0.706 0.0  0.446,
  117.                  1.176 0.0 -0.274,   1.647 0.0 -0.850,
  118.                  2.118 0.0 -0.983,   2.588 0.0 -0.603,
  119.                  3.059 0.0  0.092,   3.529 0.0  0.739,
  120.                  4.000 0.0  1.000,
  121.             # time 1.0 position
  122.                 -4.100 0.0  0.000,  -4.000 0.0  0.000,
  123.                 -3.529 0.0  0.674,  -3.059 0.0  0.996,
  124.                 -2.588 0.0  0.798,  -2.118 0.0  0.184,
  125.                 -1.647 0.0 -0.526,  -1.176 0.0 -0.962,
  126.                 -0.706 0.0 -0.895,  -0.235 0.0 -0.361,
  127.                  0.235 0.0  0.361,   0.706 0.0  0.895,
  128.                  1.176 0.0  0.962,   1.647 0.0  0.526,
  129.                  2.118 0.0 -0.184,   2.588 0.0 -0.798,
  130.                  3.059 0.0 -0.996,   3.529 0.0 -0.674,
  131.                  4.000 0.0  0.000,
  132.             ]
  133.         }
  134.     ]
  135. }
  136. ROUTE Clock.fraction_changed    TO SnakeWiggle.set_fraction
  137. ROUTE SnakeWiggle.value_changed TO Snake.set_spine
  138.